<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page import="java.util.Calendar" %>
<head>
<meta http-equiv="refresh" content="20" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Today's Messages</title>

<%@ include file="links.jsp" %>

<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript"> 
 
  //Load the Visualization API and the ready-made Google table visualization
  google.load('visualization', '1', {'packages':['table']});
 
  // Set a callback to run when the API is loaded.
  google.setOnLoadCallback(init);
 
  // Send the query to the data source.
  function init() {
 
    // Specify the data source URL.
    
    <%
    Calendar today = Calendar.getInstance();
    %>
    var query = new google.visualization.Query('../getlatestmessages');
 
    // Send the query with a callback function.
    query.send(handleQueryResponse);
  }
 
  // Handle the query response.
  function handleQueryResponse(response) {
    if (response.isError()) {
      alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
      return;
    }
 
    // Draw the visualization.
    var data = response.getDataTable();
    var chart = new google.visualization.Table(document.getElementById('chart_div'));
    chart.draw(data, {'sortColumn':6, 'sortAscending':false, allowHtml: true});
  }
  </script>

</head>
<body id="index">

<div id="page" class="xgrid xfluid">

<div id="header" class="x12">
<div class="xpad">
<h1>Today's Messages</h1>
</div>
</div>
<%@ include file="headermenu.jsp" %>
</div>

<div id="chart_div"></div>

</body>
</html>